package cn.ming.wfchat.app.me.activity.adapter;

import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import cn.ming.wfchat.R;
import cn.ming.wfchat.app.me.activity.model.MoneyFlowingWaterBean;

public class FlowingWaterAdapter extends BaseQuickAdapter<MoneyFlowingWaterBean.WalletLog, BaseViewHolder> {

    public FlowingWaterAdapter(List<MoneyFlowingWaterBean.WalletLog> data) {
        super(R.layout.item_flowing_water, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MoneyFlowingWaterBean.WalletLog item) {
        helper.setText(R.id.tv_timer, item.getCreateTime());
        TextView tv_amount = helper.getView(R.id.tv_amount);
        if (item.getAmount() > 0) {
            tv_amount.setTextColor(mContext.getResources().getColor(R.color.base_EA5668));
        } else {
            tv_amount.setTextColor(mContext.getResources().getColor(R.color.base_54C260));
        }
        helper.setText(R.id.tv_amount, item.getAmount() + "FJ");
        helper.setText(R.id.tv_balance, item.getBalance() + "FJ");
//        if (TextUtils.equals(item.getLogEnum(), MoneyFlowingWaterActivity.logEnum.RECHARGE.name())) {
//            helper.setText(R.id.tv_title, "充值");
//        } else if (TextUtils.equals(item.getLogEnum(), MoneyFlowingWaterActivity.logEnum.WITHDRAW.name())) {
//            helper.setText(R.id.tv_title, "提现");
//        } else if (TextUtils.equals(item.getLogEnum(), MoneyFlowingWaterActivity.logEnum.TRANSFER.name())) {
//            helper.setText(R.id.tv_title, "转账");
//        } else if (TextUtils.equals(item.getLogEnum(), MoneyFlowingWaterActivity.logEnum.MOMENTS.name())) {
//            helper.setText(R.id.tv_title, "付费");
//        } else if (TextUtils.equals(item.getLogEnum(), MoneyFlowingWaterActivity.logEnum.OMMISSION.name())) {
//            helper.setText(R.id.tv_title, "佣金");
//        }
        helper.setText(R.id.tv_title, item.getLogEnumDesc());

    }
}
